#include "main.h"
#include "CThreadMain.h"
#include "bsp_activeBuzzer.h"
#include "bsp_key.h"

extern ManActiveBuzzer manActiveBuzzer;








uint32_t CThreadMain::Post( void *srcNcache, uint32_t totalLen) {
   return m_inNfifo->PushNtapes(srcNcache,totalLen);
}






CThreadMain::CThreadMain(){

    m_inNfifo = new CxNfifo(256);
}





void CThreadMain::Run(void){
    m_running = true;
    pinMode(2, OUTPUT);
    bspActiveBuzzerInit();
    bspKeyInit();
    while(true) {
        RtxDelay(10);
        uint32_t ms=millis();
        //manActiveBuzzer.tick();
        //ManKey::tickAll(ms);
        m_len = m_inNfifo->PopNtapes(m_bBuffer, m_size);
        if (m_len >0) {
            printf("m_in %d   \n",m_len);
        }

    }
}



